// 设备详情model
class DeviceInfoModel {
  int? id;
  String? devId;
  String? name;
  int? model;
  String? type;
  String? gwid;
  String? sModel;
  String? custom;
  String? ip;
  String? config;
  String? firm;
  String? describe;
  String? parentsid;
  String? parentsmodel;
  Map? region;
  bool? online;
  bool? hasEvent;
  Map? allConfig;

  DeviceInfoModel(
      {id,
      devId,
      name,
      model,
      type,
      gwid,
      sModel,
      custom,
      ip,
      config,
      firm,
      describe,
      parentsid,
      parentsmodel,
      region,
      online,
      hasEvent,
      allConfig});

  DeviceInfoModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    devId = json['dev_id'];
    name = json['name'];
    model = json['model'];
    type = json['type'];
    gwid = json['gwid'];
    sModel = json['_model'];
    custom = json['custom'];
    ip = json['ip'];
    config = json['config'];
    firm = json['firm'];
    describe = json['describe'];
    parentsid = json['parentsid'];
    parentsmodel = json['parentsmodel'];
    region = json['region'];
    online = json['online'];
    hasEvent = json['has_event'];
    allConfig = json['all_config'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['dev_id'] = devId;
    data['name'] = name;
    data['model'] = model;
    data['type'] = type;
    data['gwid'] = gwid;
    data['_model'] = sModel;
    data['custom'] = custom;
    data['ip'] = ip;
    data['config'] = config;
    data['firm'] = firm;
    data['describe'] = describe;
    data['parentsid'] = parentsid;
    data['parentsmodel'] = parentsmodel;
    if (region != null) {
      data['region'] = region;
    }
    data['online'] = online;
    data['has_event'] = hasEvent;
    if (allConfig != null) {
      data['all_config'] = allConfig;
    }
    return data;
  }
}
